package com.song.su.controller;

import com.song.su.mapper.CommentMapper;
import org.apache.ibatis.annotations.Param;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.GetMapping;
import org.springframework.web.bind.annotation.RequestParam;

@Controller
public class LikeController {

    @Autowired
    CommentMapper commentMapper;

    @GetMapping("/like")
    public String  like(@RequestParam(name="isbn") String isbn,
                        @RequestParam(name="accountname") String accountname,
                        @RequestParam(name = "comContext") String comContext){
        commentMapper.Like(isbn,accountname,comContext);
        return "redirect:/book?isbn="+isbn;
    }
}
